<?php
require( 'Conf.php');
Conf::import( include '../../../conf/msgconf.php' );

$type=$_POST['type'];
$var1=$_POST['var1'];
$var2=$_POST['var2'];

switch($type){
case 0:
$accMail=Conf::get( 'sysMailAccount' );
$pwdMail=Conf::get( 'pwdMail' );
$table_change = array("$accMail"=>"$var1","$pwdMail"=>"$var2");
$content=file_get_contents('../../../conf/msgconf.php');
$content=strtr($content,$table_change);
file_put_contents('../../../conf/msgconf.php',$content);
echo 0;
break;

case 1:
$accQQ=Conf::get( 'sysQQAccount' );
$pwdQQ=Conf::get( 'pwdQQ' );
$table_change = array("$accQQ"=>"$var1","$pwdQQ"=>"$var2");
$content=file_get_contents('../../../conf/msgconf.php');
$content=strtr($content,$table_change);
file_put_contents('../../../conf/msgconf.php',$content);
break;

case 2:
$file=Conf::get( 'txtMouldForTarget' );
$content=file_get_contents($file);
file_put_contents($file,$var1);
echo 0;
break;

case 3:
$file=Conf::get( 'txtMouldForOthers' );
$content=file_get_contents($file);
file_put_contents($file,$var1);
break;

default:
echo 1;
break;
}
?>